package com.engine4cloud.tdf.admin.api.feign;

import com.engine4cloud.tdf.admin.api.dto.UserRoleResultDTO;
import com.engine4cloud.tdf.common.core.constant.SecurityConstants;
import com.engine4cloud.tdf.common.core.constant.ServiceNameConstants;
import com.engine4cloud.tdf.common.core.util.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestHeader;

import java.util.List;

/**
 * @author tdf
 * @date 2024/4/17
 * <p>
 * 行政区划接口
 */
@FeignClient(contextId = "remoteUserRoleService", value = ServiceNameConstants.SYS_SERVICE)
public interface RemoteUserRoleService {

    /**
     * 获取角色
     *
     * @param userId 用户id
     * @param from   内外部标识
     * @return R<List < UserRoleResultDTO>>
     */
    @GetMapping("/sysUserRole/list/{userId}")
    R<List<UserRoleResultDTO>> roleListByUserId(@PathVariable("userId") Long userId, @RequestHeader(SecurityConstants.FROM) String from);

}
